package sanrenxing.dayEnd.backRepertoryTotal.dao;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import sanrenxing.dayEnd.backRepertoryTotal.domain.Wave;

import java.util.List;

public interface WaveDao {

    /**
     * 股票价格波动表
     * @param start
     * @param end
     * @return
     */
    @Select("select * from (select rownum rn,sts.seId,fst.seName,sts.costs,md.closePrice,md.openPrice,(md.closePrice-md.openPrice)/md.openPrice*100 as ranges from \n" +
            "securitiesStock sts join marketData md on sts.seId=md.seId join financialsecurities fst on fst.seId=sts.seId) where rn between #{start} and #{end}")
    public List<Wave> selectByPage(@Param("start") int start, @Param("end") int end);

    /**
     * 获得行数
     * @return
     */
    @Select("select count(*) from securitiesStock sts join marketData md on sts.seId=md.seId join financialsecurities fst on fst.seId=sts.seId")
    public int count();

}
